package com.feihao.zhou.countDownLatch;

import java.util.concurrent.CountDownLatch;

public class ChildThread1 implements Runnable{
    private CountDownLatch countDownLatch;

    public ChildThread1(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }
    @Override
    public void run() {
        //任务：吃饺子：
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+
                    "在吃第" + i+"个饺子");

        }
        countDownLatch.countDown();
    }
}
